﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Zero.Frontend
{
    /// <summary>
    /// Shorthand methods for cleaner code.
    /// </summary>
    public static class Show
    {
        /// <summary>
        /// Allows showing, opening and inicializing child screen.
        /// </summary>
        /// <typeparam name="TChild"></typeparam>
        /// <returns></returns>
        public static OpenChildResult<TChild> Child<TChild>()
        {
            return new OpenChildResult<TChild>();
        }

        /// <summary>
        /// Allows showing, opening and inicializing child screen. With specific instance of child screen.
        ///  </summary>
        /// <typeparam name="TChild"></typeparam>
        /// <returns></returns>
        public static OpenChildResult<TChild> Child<TChild>(TChild child)
        {
            return new OpenChildResult<TChild>(child);
        }

        /// <summary>
        /// Shows busy indicator.
        /// </summary>
        /// <param name="busyViewModel"></param>
        /// <returns></returns>
        public static BusyResult Busy(object busyViewModel = null)
        {
            return new BusyResult(true, busyViewModel);
        }

        //public static OpenDialogResult<TDialog> Dialog<TDialog>()
        //    where TDialog : IDialog
        //{
        //    return new OpenDialogResult<TDialog>();
        //}

        //public static OpenDialogResult<TDialog> Dialog<TDialog>(TDialog dialog)
        //    where TDialog : IDialog
        //{
        //    return new OpenDialogResult<TDialog>(dialog);
        //}

        /// <summary>
        /// Hides busy indicator.
        /// </summary>
        /// <param name="busyViewModel"></param>
        /// <returns></returns>
        public static BusyResult NotBusy(object busyViewModel = null)
        {
            return new BusyResult(false, busyViewModel);
        }
    }
}
